# lambda来创建匿名函数

f1 = lambda : "hello world!"
print(f1())

f2 = lambda x, y : x * y
print(f2(3,5))


numbers = [1,2,3,4,5,6,7,8]
squared = list(map(lambda x : x ** 2, numbers))
print(squared)

even_numbers = list(filter(lambda x : x % 2 == 0, numbers))
print(even_numbers)

from functools import reduce
product = reduce(lambda x, y : x + y, numbers)
print(product)